<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>${model.title }</title>
<%@include file="/common/extjs.jsp" %>
<%@include file="/common/uploadify.jsp"%>
<script type="text/javascript" src="${ctx}/pages/admin/fileattch/fileattch.js"></script>
<LINK href="${ctx}/styles/style.css" type='text/css' rel='stylesheet'>
<LINK href="${ctx}/pages/admin/fileattch.css" type='text/css' rel='stylesheet'>
</head>
<body>
<%@include file="/pages/scos/common/top.jsp" %>
<table width="900" align="center">
  <tr>
    <td>
      <div style="font-size:16px; font-weight: bold; height:30px; line-height:30px; text-align: center;">
		${model.title}
	  </div>
	  <div style="text-align: center; padding:5px 10px;">
	    &nbsp;&nbsp;发布人：${model.author.name}
	    &nbsp;&nbsp;发布于：<s:date name="model.createTime" format="yyyy-MM-dd HH:mm"/>
        &nbsp;&nbsp;浏览${model.hits}次
	  </div>
	  <div style="border-top:1px solid #99BBE8; padding: 5px 10px;">
	    ${model.content}
	    <div style="padding: 5px 10px;">
          <div id="systop_file_list"></div>
	    </div>
	    <div align="right">【完】</div>
	  </div>
    </td>
  </tr>
</table>
	
<s:form id="saveForm" action="/news/comment/commentSave.do"  target="commonList" method="post">
<input type="hidden" name="newsId" value="${model.id}">
<table width="900" align="center" style="border:1px solid #A9BFD3; border-top:0px;" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="4" class="x-toolbar" style="height: 25px; padding-left: 10px;"><b>发表评论</b></td>
  </tr>
  <tr>
    <td width="100" align="center" valign="middle">
  	   内容：
    </td>
    <td width="500" style="padding: 5px 5px;" valign="middle">
      <s:textarea id="content" name="commentContent" cssStyle="width:450px; height:50px" cssClass="required"/> 
      <font color="red">&nbsp;*</font>
    </td> 
    <td width="150">
      <input type="button" class="button" value="&nbsp;发表&nbsp;"  onClick="onSave()"><br><br>
      <input type="button" class="button" value="&nbsp;关闭&nbsp;"  onClick="javascript:window.close();">
    </td>
    <td width="150">&nbsp;</td>
  </tr>
</table>	
</s:form>

<table width="900" align="center">
  <tr>
    <td style="padding-top: 10px;">
      <iframe width="900" height="450" name="commonList" src="${ctx}/news/comment/index.do?newsId=${model.id}" frameborder="0"></iframe>
   </td>
  </tr>
</table>
<%@include file="/pages/scos/common/bottom.jsp" %>

<script type="text/javascript">
//渲染上传组件
renderUploader();
viewFileAttchList('${model.attachIds}', false);

function onSave() {
	var content = document.getElementById('content').value;	
    if (content == null || content == '') {
        Ext.MessageBox.show({
             title:'提示',
             minWidth:220,
             msg:'<div style=\'width:180\';><br/>请您输入发表内容！</div>',
             buttons:Ext.MessageBox.OK,
             icon:Ext.MessageBox.INFO
        });
        return false;
     }
    document.getElementById('saveForm').submit();
}
</script>
</body>
</html>